﻿#include"stdafx.h"
#ifdef LK_
namespace LK{
#ifndef new
#ifdef LK_BLOCKMEMORYALLOC_
	BlockMemory<sizeof(index_t)*2+sizeof(Mutex)+4>&
	 RefCount::RefCountPool(){
		static BlockMemory<sizeof(index_t)*2+sizeof(Mutex)+4>* p;
		if (p)return *p;
		Mutex::GetDefaultRef().Lock();
		if (!p){
			static BlockMemory<sizeof(index_t)*2+sizeof(Mutex)+4> pool;
			p = &pool;
		}
		Mutex::GetDefaultRef().UnLock();
		return *p;
	}
#endif
#endif
	//是否默认启用互锁机制
	bool& RefCount::GetDefaultEnableThreadSafe()
	{
		static bool b = false;
		return b;
	}

}
#endif
